package com.ldg.manager.controller;

import com.ldg.manager.entity.ContentEntity;
import com.ldg.manager.service.ContentService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: Liudao
 * @Date: 2022-09-21-16:03
 * @Description:
 */
@Controller
public class PortalController {

    @Resource
    private ContentService contentService;

    @RequestMapping({"/","/index.html"})
    public String index(Model model){
        List<ContentEntity> list = contentService.findContentListByCategoryId(1);
        model.addAttribute("list",list);

        return "index";
    }
}
